package com.mycompany.model;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

/**
 * Modelo para el requisito de informacion: control acceso
 * @author javachavez@gmaill.com
 *
 */

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "id",
    "origen",
    "destino",
    "protocolo",
    "accion"
})
@XmlRootElement(name = "controlAcceso")
public class ControlAcceso {
	@XmlElement(required = true , nillable=false)
	private Long id;
	@XmlElement(required = true, nillable=false)
	private String origen;
	@XmlElement(required = true, nillable=false)
	private String destino;
	@XmlElement(required = true, nillable=false)
	private String protocolo;
	@XmlElement(required = true,nillable=false)
	private String accion;
	
    public ControlAcceso (){
    	super();
    }
    
    public ControlAcceso (String origen, String destino, String protocolo, String accion){
    	super();
    	this.id=new Long(-1);
    	this.origen=origen;
    	this.destino=destino;
    	this.protocolo=protocolo;
    	this.accion=accion;
    }
    
    public ControlAcceso (Long id,String origen, String destino, String protocolo, String accion){
    	super();
    	this.id=id;
    	this.origen=origen;
    	this.destino=destino;
    	this.protocolo=protocolo;
    	this.accion=accion;
    }

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getOrigen() {
		return origen;
	}
	public void setOrigen(String origen) {
		this.origen = origen;
	}

	public String getDestino() {
		return destino;
	}
	public void setDestino(String destino) {
		this.destino = destino;
	}

	public String getProtocolo() {
		return protocolo;
	}
	public void setProtocolo(String protocolo) {
		this.protocolo = protocolo;
	}

	public String getAccion() {
		return accion;
	}
	public void setAccion(String accion) {
		this.accion = accion;
	}
	
	@Override
	public String toString() {
		return " ["+id +" from " + origen + " to " + destino 
				+ " with " + protocolo + " => " + accion + "]";
	}
}
